Improve names and types in Rust stdlib scraper#2596
Merged
simon04 merged 1 commit intofreeCodeCamp:mainfrom Oct 21, 2025
Merged
Improve names and types in Rust stdlib scraper#2596simon04 merged 1 commit intofreeCodeCamp:mainfrom
simon04 merged 1 commit intofreeCodeCamp:mainfrom
Conversation
Two main fixes:
1. Names: all pages except for modules' index pages ignored what module
they were from, and were just prepended with `std::`. This meant
there were 13 pages named `std::Iter`, about structs named `Iter`
from different modules. It also meant that things outside modules,
e.g. primitive types, were prefixed with `std::`, naming the page on
`bool` as `std::bool`, although it can't be referenced that way in
code. This also means that there are two pages named `std::char` -
one for the module, and one for the primitive type `char`.
This prefixes everything in a module with that module's path, and
does not prefix primitives. It also includes submodules in the path.
For example:
std::fn → fn
std::Iter → std::option::Iter
std::MetadataExt → std::os::linux::fs::MetadataExt
2. Types: almost everything was filed in `std`, with the exception of
modules' index pages and primitive types. This meant there were over
30,000 pages in the `std` type, and many types for modules with only
one page in them.
This creates types for each module which include all submodules, and
files anything not in a module, e.g. primitive types, in `std`.
For example:
std::bool / std::bool → std / bool
std / std::Iter → std::option / std::option::Iter
std / std::MetadataExt → std::os / std::os::linux::fs::MetadataExt
e11c68c to
fbb5e61
Compare
simon04
approved these changes
Oct 21, 2025
Contributor
simon04
left a comment
There was a problem hiding this comment.
Thank you, very much appreciated!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up to #2569, addressing issues with the standard library scraper I mentioned here.
There are two main fixes:
Names: all pages except for modules' index pages ignored what module they were from, and were just prepended with
std::. This meant there were 13 pages namedstd::Iter, about structs namedIterfrom different modules. It also meant that things outside modules, e.g. primitive types, were prefixed withstd::, naming the page onboolasstd::bool, although it can't be referenced that way in code. This also means that there are two pages namedstd::char- one for the module, and one for the primitive typechar.This prefixes everything in a module with that module's path, and does not prefix primitives. It also includes submodules in the path.
For example:
Types: almost everything was filed in
std, with the exception of modules' index pages and primitive types. This meant there were over 30,000 pages in thestdtype, and many types for modules with only one page in them.This creates types for each module which include all submodules, and files anything not in a module, e.g. primitive types, in
std.For example:
Or, in screenshots – before:
and after: